A single photon avalanche detector (SPAD) is based on a p-n junction device biased beyond its breakdown region. A high reverse bias voltage generates a sufficiently large electric field such that a single charge carrier introduced into a depletion layer of the p-n junction device can cause a self-sustaining avalanche. The charge carrier may be released by the impact of a photon (impact ionization). The SPAD may be quenched, allowing the device to be reset to detect further photons. The behavior of the SPAD may vary depending on one or more factors such as temperature, aging and process variation.